{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fd115212",
   "metadata": {},
   "source": [
    "## 1.np.empty(shape, dtype)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "06166c3b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "# 创建一个3x2的数组，不初始化元素值\n",
    "array9 = np.empty((3, 2))\n",
    "print(\"未初始化的数组：\\n\", array9)\n",
    "\n",
    "# 创建一个2x3的数组，数据类型为int\n",
    "array10 = np.empty((2, 3), dtype=int)\n",
    "print(\"\\n指定类型未初始化的数组：\\n\", array10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30f7068e",
   "metadata": {},
   "source": [
    "## 2.np.full()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "50ebd68f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[7 7 7]\n",
      " [7 7 7]]\n"
     ]
    }
   ],
   "source": [
    "arr = np.full((2, 3), 7)  # 创建一个2x3的数组，所有元素为7\n",
    "print(arr)  # 输出: [[7 7 7]\n",
    "            #          [7 7 7]]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
